<template>
<ShAnnexSubCateGory :attachmentConfigs="attachmentConfigs" :subCategoryItem="subCategoryItem" :beforeUpload="beforeUpload"></ShAnnexSubCateGory>
</template>

<script setup>
import { reactive } from 'vue';

const subCategoryItem = reactive({
    fileMaximum: 1,
    fileList: [],
    subCategoryName: '',
    uploadOperation: 1,
    fileFormat: 'excel'
})

const attachmentConfigs = {
    showDelete: true,
        showUpload: true,
        showDown: true,
        showTopBar: false,
        showStandard: false,
        showApproveFlag: false,
        showAllBlank: false,
        showEmptySubclass: true,
        multiple: false,
}

const beforeUpload = (files)=> {
    const res = files.map(item => {
    return {
      path: 'http://huaxia.dev.godsuy.com/group1/M00/00/00/wKhYIWQ-ggOAcK21AALcfK4pvPM676.png',
      thumbnailUrl: 'http://huaxia.dev.godsuy.com/group1/M00/00/00/wKhYIWQ-ggOAcK21AALcfK4pvPM676.png',
      type: item.type,
    };
  });
  const status = '200';
  return new Promise((resolve, reject) => {
    if (status == 200) {
      resolve(res);
    } else {
      reject('错误');
    }
  });
}
</script>